using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace EuropeEngulfed.NET
{
    partial class VictoryDialog : Form
    {
        private GameController.Victory victory;
        private string vitoryString;
        private Font font;
        public VictoryDialog(GameController.playerType player, GameController.Victory victory)
        {
            InitializeComponent();
            this.victory = victory;
            switch(victory)
            {
                case GameController.Victory.AlliedDecisiveVictory:
                    if (player == GameController.playerType.AlliedPlayer)
                        victoryPictureBox.Image = global::EuropeEngulfed.NET.Properties.Resources.churchillsV;
                    else
                        victoryPictureBox.Image = global::EuropeEngulfed.NET.Properties.Resources.Dresden;
                    vitoryString = "Allied Decisive Victory";
                    break;
                case GameController.Victory.AlliedOperationalVictory:
                    vitoryString = "Allied Operational Victory";
                    if (player == GameController.playerType.AlliedPlayer)
                        victoryPictureBox.Image = global::EuropeEngulfed.NET.Properties.Resources.arcDeTriumph;
                    else
                        victoryPictureBox.Image = global::EuropeEngulfed.NET.Properties.Resources.sovietFlagOverBerlin;
                    break;
                case GameController.Victory.AlliedMarginalVictory:
                    vitoryString = "Allied Marginal Victory";
                    if (player == GameController.playerType.AlliedPlayer)
                        victoryPictureBox.Image = global::EuropeEngulfed.NET.Properties.Resources.parisV;
                    else
                        victoryPictureBox.Image = global::EuropeEngulfed.NET.Properties.Resources.sovietFlagOverBerlin;
                    break;
                case GameController.Victory.Draw:
                    vitoryString = "Draw";
                    if (player == GameController.playerType.AlliedPlayer)
                        victoryPictureBox.Image = global::EuropeEngulfed.NET.Properties.Resources.britishTeaParty;
                    else
                        victoryPictureBox.Image = global::EuropeEngulfed.NET.Properties.Resources.britishTeaParty;
                    break;
                case GameController.Victory.AxisDecisiveVictory:
                    if (player == GameController.playerType.AlliedPlayer)
                        victoryPictureBox.Image = global::EuropeEngulfed.NET.Properties.Resources.frenchmancrying;
                    else
                        victoryPictureBox.Image = global::EuropeEngulfed.NET.Properties.Resources.Nuremberg;
                    vitoryString = "Axis Decisive Victory";
                    break;
                case GameController.Victory.AxisOperationalVictory:
                    if (player == GameController.playerType.AlliedPlayer)
                        victoryPictureBox.Image = global::EuropeEngulfed.NET.Properties.Resources.germanVicInParis;
                    else
                        victoryPictureBox.Image = global::EuropeEngulfed.NET.Properties.Resources.Nuremberg2;
                    vitoryString = "Axis Operational Victory";
                    break;
                case GameController.Victory.AxisMarginalVictory:
                    victoryPictureBox.Image = global::EuropeEngulfed.NET.Properties.Resources.germanVicInWarsaw;
                    vitoryString = "Axis Marginal Victory";
                    break;
            }

            this.victoryPictureBox.Size = this.victoryPictureBox.Image.Size;
            this.Size = this.victoryPictureBox.Image.Size;
            font = new Font("Century Gothic", 16, FontStyle.Bold);
        }

        private void victoryPictureBox_Paint(object sender, PaintEventArgs e)
        {
            e.Graphics.DrawString(vitoryString, font, new SolidBrush(Color.Red), new Point((int)(this.Width / 2) - (int)(e.Graphics.MeasureString(vitoryString, font).Width / 2), this.Height / 2));
        }
    }
}